//
//  UIAlertController+normalAlert.m
//  One
//
//  Created by mac on 16-5-20.
//  Copyright (c) 2016年 mac. All rights reserved.
//

#import "UIAlertController+normalAlert.h"

@implementation UIAlertController (normalAlert)

+ (UIAlertController *)alertWithMessage:(NSString *)message withActionBlock :(Block)actionBlock
{
    UIAlertController *alertCon = [UIAlertController alertControllerWithTitle:@"提示" message:message preferredStyle:UIAlertControllerStyleAlert];
    alertCon.view.backgroundColor = [UIColor blackColor];
    [alertCon performSelector:@selector(timerMethod:) withObject:nil afterDelay:2];
//    UIAlertAction *alertAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
//        if (actionBlock) {
//            actionBlock();
//        }
//    }];
//    
//    [alertCon addAction:alertAction];
    
    
    return alertCon;
}

- (void)timerMethod:(UIAlertController *)alert
{
    [alert dismissViewControllerAnimated:YES completion:nil];
}

@end
